/*
 * bsp_core.h
 *
 * Copyright (C) 2011 - Dr.NP
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * @version bsp_core.h 1.0.0
 * @package libbspcore
 * @author Dr.NP <np@bsgroup.org>
 * @update 03/20/2011
 */

#ifndef BSP_CORE_H

#define BSP_CORE_H                              1

#include <time.h>

#include "bsp_conf.h"
#include "bsp_hash.h"
#include "bsp_log.h"
#include "bsp_mempool.h"
#include "bsp_object.h"
#include "bsp_socket.h"
#include "bsp_thread.h"
#include "bsp_timer.h"
#include "bsp_types.h"
#include "bsp_utils.h"

// Definations
#define DEFAULT_APP_SCRIPT                      "etc/app.lua"
#define DEFAULT_NWORKERS                        "-1"

// Macros

// Structs
struct core_t
{
    int nfiles;
    int nworkers;
    int epoll_fd;
    int notify_event_fd;
    int is_running;
    time_t start_time;
};

// Functions
int core_init(char *);
int core_init_minimal();
int core_add_server(int);
int core_add_connector(int);
int core_add_timer(int);
void core_loop(void(*)(int));

#endif  /* bsp_core.h */
